#include "mainwindow.h"
#include "ui_mainwindow.h"

#import "ffmpegs.h"

MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);
}

MainWindow::~MainWindow()
{
    delete ui;
}

void MainWindow::on_audioButton_clicked() {

    AudioEncodeSpec in;
    in.filename = "/Users/os/Desktop/FFmpegProject/pcm_to_aac2/44100_s16le_2.pcm";
    in.sampleRate = 44100;
    in.sampleFmt = AV_SAMPLE_FMT_S16;
    in.chLayout = AV_CH_LAYOUT_STEREO;

    FFmpegs::aacEncode(in, "/Users/os/Desktop/FFmpegProject/pcm_to_aac2/out.aac");

//    if (!_audioThread) {
//        _audioThread = new AudioThread(this);
//        _audioThread->start();
//    } else {
//        _audioThread->requestInterruption();
//        _audioThread = nullptr;
//    }
}
